$(function(){
	var complainId = getUrlParam('complainId');
	$('#complainId').val(complainId);
	initForm(complainId);
})

function initForm(complainId){
	console.log(projectPath);
	var infoUrl = projectPath + "consulting/list.do";
	
	$.ajax({ 
		url: infoUrl,
		method: 'post',
		data:JSON.stringify({"complainId": complainId}),
		dataType: "json",
		contentType: "application/json",
		success: function(data){ 
			bindFormConsultingInfo(data.rows[0]);
      	}
	});
}

function bindFormConsultingInfo(data){
	console.log(data);
	$('[name="userName"]').html(data.userName);
	$('[name="mobile"]').html(data.mobile);
	$('[name="email"]').html(data.email);
	$('[name="businessType"]').html(data.businessType);
	$('[name="complainType"]').html(data.complainType);
	$('[name="complainTitle"]').html(data.complainTitle);
	$('[name="leaveMessage"]').html(data.leaveMessage);
	$('[name="replyMessage"]').html(data.replyMessage);
	$('[name="sysdeptname"]').html(data.sysdeptname);
	$('[name="syscreatedbyname"]').html(data.syscreatedbyname);
	$('[name="replyTime"]').html(data.replyTime);
	
	
}

